<extend name="Public:base"/>

<block name="main">
<style>
#preview{position:absolute;border:1px solid #ccc;background:#333;padding:5px;display:none;color:#fff;}
#preview img{width:200px;height:200px;}
</style>

<load href="./Public/js/swfupload.js"/>
<form name="myform" id="myformb" action="" method="post">

<div class="table-in">
    <table width="100%" cellspacing="0" >
      <thead>
        <tr>
          <th width="60">产品分类</th>
          <th width="60">标题</th>
          <th>缩略图</th>
          <th width="340">产品内容</th>
          <th>图片列表</th>
          <th>推荐位</th>
          <th>&nbsp;</th>
          </tr>
        </thead>
        <tbody>
          <tr>
     <td><select title="必须选择一个栏目" validate=" minlength:1, maxlength:6, required:true" class="selectp valid" name="plist[0][catid]" id="catid"><option value="">请选择</option><option disabled="" value="4"> 产品展示</option><option selected="" value="5">&nbsp;├ 产品分类1</option><option value="6">&nbsp;├ 产品分类2</option><option value="7">&nbsp;├ 产品分类3</option><option value="9">&nbsp;└ 产品分类4</option><option value="13"> 产品分类5</option></select></td>
     <td><input type="text" name="plist[0][title]" value="产品名称" class="titleh" /></td>
     <td align="center"><input id="thumb" type="hidden" class="thumb" type="text" name="plist[0][thumb]" value="" />
      <div class="thumbb" style ="width:97px;height:80px;padding:2px;top:70px;">
        <a href="javascript:swfupload('thumb_uploadfile','thumb','{:L(uploadfiles)}',1,1,1,1,'jpeg,jpg,png,gif',1,3,'{$yzh_auth}',bulk,nodo)"><img style="width:50px;height: 50px;" width="50" height="50" src="<if condition="!empty($vo['value'])">{$vo['value']}<else/>./Public/images/admin_upload_thumb.png</if>" id="thumb_pic" ></a><br> <input type="button" value="{:L('clean_thumb')}" onclick="javascript:clean_thumb('thumb');" class="btn btn-sm btn-primary" style="margin:0;" />
      </div>
      </td>
     <td><textarea id="content" class="pcontent" cols="55" rows="4" name="plist[0][content]">产品内容...</textarea></td>
     
     <td>
     <div class="piclist">
      <ul id="pics_0_images">
           <li class="f-on">最多同时可以上传<font color="red">10</font> 张</li>
      </ul>
     </div>
     <input type="button" onclick="javascript:swfupload('pics_uploadfile','pics_0','文件上传',1,1,0,10,'jpeg,jpg,gif',2,3,'',up_imagess,nodo)" value="图片上传" class="button picsbut">
     </td>
     <td>
     <input id="posid_1" class="input_checkbox " type="checkbox" value="1"  name="plist[0][posid][]">推荐 &nbsp;
         <input id="posid_2" class="input_checkbox " type="checkbox" value="2"  name="plist[0][posid][]">热门
         </td>
     <td><a href="javascript;" onclick="$(this).parent().parent().remove();return false;">删除</a></td>
     </tr>

         <tr class="endp">
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>&nbsp;</td>
     <td>
     <a id="add" href="javascript;">添加</a>
         </td>
     </tr>
        </tbody>
    </table>
</div>
<div class="h38"></div>
<div class="btn" id="btnbox"><input type="hidden" value="1" name="lang"><input type="hidden" value="/index.php?a=index&m=Product&g=Admin&menuid=22" name="forward"><input type="submit" class="btn btn-sm btn-primary" value="提交"><input type="reset" class="btn btn-sm btn-primary" value="取消"></div>
</form>
<script>
//增加产品函数
$("#add").click(function(){
 var num=$('.table-in tr').length-2;
 $(this).parent().parent().before('<tr><td><select title="必须选择一个栏目" validate=" minlength:1, maxlength:6, required:true" class="selectp valid" name="plist['+num+'][catid]" id="catid"><option value="">请选择</option><option disabled="" value="4"> 产品展示</option><option selected="" value="5">&nbsp;├ 产品分类1</option><option value="6">&nbsp;├ 产品分类2</option><option value="7">&nbsp;├ 产品分类3</option><option value="9">&nbsp;└ 产品分类4</option><option value="13"> 产品分类5</option></select></td><td><input type="text" name="plist['+num+'][title]" value="产品名称" class="titleh" /></td><td align="center"><input id="thumb_'+num+'" type="hidden" class="thumb" type="text" name="plist['+num+'][thumb]" value="/" /><div class="thumbb" style ="width:97px;height:80px;padding:2px;top:70px;"><a href="javascript:swfupload(\'thumb_uploadfile\',\'thumb_'+num+'\',\'{:L(uploadfiles)}\',1,1,1,1,\'jpeg,jpg,png,gif\',1,3,\'{$yzh_auth}\',bulk,nodo)"><img style="width:50px;height: 50px;" width="50" height="50" src="<if condition="!empty($vo[value])">{$vo[value]}<else/>./Public/images/admin_upload_thumb.png</if>" id="thumb_'+num+'_pic" ></a><br> <input type="button" value="{:L(\'clean_thumb\')}" onclick="javascript:clean_thumb(\'thumb_'+num+'\');" class="btn btn-sm btn-primary" style="margin:0;" /></div></td> <td><textarea id="content" class="pcontent" cols="55" rows="4" name="plist['+num+'][content]">产品内容...</textarea></td><td><div class="piclist"><ul id="pics_'+num+'_images"><li class="f-on">最多同时可以上传<font color="red">10</font> 张</li></ul></div><input type="button" onclick="javascript:swfupload(\'pics_uploadfile\',\'pics_'+num+'\',\'文件上传\',1,1,0,10,\'jpeg,jpg,gif\',2,3,\'\',up_imagess,nodo)" value="图片上传" class="button picsbut"></td><td><input id="posid_1" class="input_checkbox " type="checkbox" value="1"  name="plist['+num+'][posid][]">推荐 &nbsp;<input id="posid_2" class="input_checkbox " type="checkbox" value="2"  name="plist['+num+'][posid][]">热门</td><td><a href="javascript;" onclick="$(this).parent().parent().remove();return false;">删除</a></td></tr>');
 return false;
});

</script>
</block>